package com.atxiao.service.JUC;

public class ThreadService {


    public static void main(String[] args) {


        Thread thread = new Thread(() -> {

            System.out.println(Thread.currentThread().getName()+"是否为守护线程："+Thread.currentThread().isDaemon());
            while (true){
                //死循环卡住
            }
        }, "A线程");

        thread.setDaemon(true);
        thread.start();
        System.out.println("主线程的名称:"+thread.currentThread().getName());

    }


}
